<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<c:import url="/view/admin/include/header/adminHeader.jsp"></c:import>
    <!-- 컨텐츠 부분 -->
	<div id="container">
    	<!-- 왼쪽 메뉴 부분 -->
    	<c:import url="/view/admin/include/left/adminLeft.jsp"></c:import>
        <!-- 왼쪽 메뉴 부분 -->
        <!-- 오른쪽 내용 부분 -->
        <dl>
        	<dd class="path">
        	홈 > 게시판 관리 > 
        		<span class="path_b">
        			소송진행 현황
        		</span>
        	</dd>
        </dl>
        <ul class="tab qna_box">
	           <li class="on">기본정보</li>
		       <li class="off">제1심</li>
		       <li class="off">제2심</li>
		       <li class="off">대법원</li>
	    </ul>
        <dl>
        <span class="left f_orange">※ 진행 중이거나 완료된 소송기록을 확인하실 수 있습니다.</span>
          <p class="align_r"> 
        	<span class="right f11"><span class="f_red">*</span> 는 필수입력항목입니다.</span>
        </dl>
        <dl class="content">
            <dd class="summary">
            	<form id="boardFrm" name="boardFrm" action="/admin/caseReg.hcom" method="post" enctype="multipart/form-data">
            	<input type="hidden" name="mem_no"	value="<s:property value="#session.id" />"> 
            	<input type="hidden" name="writer" value="<s:property value="#session.name" />"> 
            	<input type="hidden" id="save_type" name="save_type" value="case" />
            	<table cellspacing="0" cellpadding="0" summary="" >
                	<caption></caption>
                    	 <colgroup>
                          <col width="15%;"/>
                          <col width="45%;"/>
                          <col width="10%;"/>
                          <col width="30%"/>
                         </colgroup>
                    <tbody>
                    	<tr>
                        	<th scope="row" class="table_txt_left"><span class="f_red">*</span>작성자</th>
                            <td class="table_txt_left f_blue"><s:property value="#session.name" />
                            <th scope="row" class="table_txt_left">프로젝트</th>
                            <td class="table_txt_left"><input id="order_no" name="order_no" type="text" style="width:100px;" maxlength="10"/></td>
                        </tr>
                        <tr>
                        	<th scope="row" class="table_txt_left"><span class="f_red">*</span>사건명</th>
                            <td class="table_txt_left "><input id="case_name" name="case_name" type="text" style="width:200px;" maxlength="30"/></td>
                            <th scope="row" class="table_txt_left"><span class="f_red">*</span>공개여부</th>
                            <td class="table_txt_left "><input type="radio" name="open_flag" value="Y"  />공개
                           							   <input type="radio" name="open_flag" value="N" checked/>비공개 
                           							   </td> 
                         </tr> 
                        </tr>  
            			<tr>
                         <th scope="row" class="table_txt_left"><span class="f_red">*</span>부서명</th>
                            <td class="table_txt_left ">
                          		<select id="mem_dept" name="mem_dept">
									<option value="EL31">경리부</option>
									<option value="EL28">경영지원부</option>
									<option value="EL17">고객지원1부</option>
									<option value="EL18">고객지원2부</option>
									<option value="EL22">구매부</option>
									<option value="EL26">기계개발부</option>
									<option value="EL05">기술영업부</option>
									<option value="EL33">기획관리부</option>
									<option value="EL47">나웅산전</option>
									<option value="EL19">리모델링영업부</option>
									<option value="EL34">마케팅부</option>
									<option value="EL40">미래ESP</option>
									<option value="EL38">브라질법인</option>
									<option value="EL42">상성산업</option>
									<option value="EL39">상해법인</option>
									<option value="EL21">생산부</option>
									<option value="EL15">서비스관리부</option>
									<option value="EL16">서비스마케팅부</option>
									<option value="EL45">서진E/L</option>
									<option value="EL20">설계부</option>
									<option value="EL06">설치1부</option>
									<option value="EL07">설치2부</option>
									<option value="EL08">설치관리부</option>
									<option value="EL41">수영엘텍</option>
									<option value="EL48">신라산업</option>
									<option value="EL43">신성산기</option>
									<option value="EL49">알앤엠</option>
									<option value="EL02">영업1부</option>
									<option value="EL03">영업2부</option>
									<option value="EL04">영업3부</option>
									<option value="EL37">윤리경영부</option>
									<option value="EL44">이존산업</option>
									<option value="EL27">인재개발부</option>
									<option value="EL30">재정부</option>
									<option value="EL23">제조지원부</option>
									<option value="EL25">전기제어부</option>
									<option value="EL29">준법지원부</option>
									<option value="EL56">강원지사</option>
									<option value="EL60">경기지사</option>
									<option value="EL58">경남지사</option>
									<option value="EL53">광주지사</option>
									<option value="EL52">대구지사</option>
									<option value="EL54">대전지사</option>
									<option value="EL51">부산지사</option>
									<option value="EL57">울산지사</option>
									<option value="EL59">인천지사</option>
									<option value="EL55">전주지사</option>
									<option value="EL61">제주지사</option>
									<option value="EL50">토탈세일즈</option>
									<option value="EL35">품질관리부</option>
									<option value="EL32">해외법인관리부</option>
									<option value="EL13">해외영업 1부</option>
									<option value="EL14">해외영업 2부</option>
									<option value="EL36">효율개선부</option>
									<option value="EL46">E&P</option>
									<option value="EL24">IT응용기술부</option>
									<option value="EL09">MP설치부</option>
									<option value="EL11">S/S 개발</option>
									<option value="EL12">S/S 설치</option>
									<option value="EL10">S/S 영업</option>
	            				</select>
                       		</td> 
                         <th scope="row" class="table_txt_left"><span class="f_red">*</span>소가</th>
                            <td class="table_txt_left "><input id="sue_money" name="sue_money" type="text" style="width:150px;" maxlength="15" onkeyup="number_check2(sue_money)"/> 단위 :원                         							    
                           	</td> 
                         </tr> 
                         <tr>
                         <th scope="row" class="table_txt_left"><span class="f_red">*</span>원고</th>
                            <td class="table_txt_left "><input id="plaintiff" name="plaintiff" type="text" style="width:200px;" maxlength="15"/>                         							    
                           	</td> 
                         <th scope="row" class="table_txt_left"><span class="f_red">*</span>피고</th>
                            <td class="table_txt_left "><input id="defendant" name="defendant" type="text" style="width:200px;" maxlength="15"/>                         							    
                           	</td> 
                         </tr> 
                         <tr>
                         <th scope="row" class="table_txt_left"><span class="f_red">*</span>제(피)소</th>
                            <td class="table_txt_left "><input type="radio" name="sue_flag" value="1" />제소
                           							   <input type="radio" name="sue_flag" value="0" checked/>피소 
                           							   </td> 
                         <th scope="row" class="table_txt_left"><span class="f_red">*</span>상태</th>
                            <td class="table_txt_left "><input type="radio" name="status_flag" value="P" checked/>진행
                           							   <input type="radio" name="status_flag" value="D" />완료 
                           							   </td> 
                         </tr>   
                         <tr>
                         <th scope="row" class="table_txt_left">기타</th>
                            <td class="table_txt_left " colspan="4"><input id="etc" name="etc" type="text" style="width:630px;" maxlength="20"/>
                           							   </td> 
                        
                         </tr>
                         
                         <tr>
	                       <td class="table_txt_left table_td_bottom_x padding5">
	                        		<span class="f_black b"><span class="f_red">*</span>사건개요</span>
	                       </td>
	                       	    <td class="table_td_bottom_x padding5"></td>
	                            <td class="table_td_bottom_x padding5"></td>
	                        </tr>
	                        <tr>
	                        	<td class="table_txt_left table_td_bottom_comment" colspan="4"><textarea id="summary" name="summary" style="width:99%; height:100px;"></textarea></td>	                        	
	                        </tr> 
                       <%--  <tr>
							<th scope="row">첨부파일</th>
							<td class="table_txt_left" style="font-size:11px;">
								<input type="text" id="file_name1" class="input" style="width:200px; height:14px;"  title="첨부파일" readonly="readonly"/>
                  					<span class="file_input">
                  				<input type="file" name="uploads" class="file_input_hidden" title="첨부파일" onchange="javascript: document.getElementById('file_name1').value = this.value" style="cursor: pointer;"/>
                  					<img src="/images/common/btn_file.gif" alt="첨부파일" name="find" id="find" border="0" style="cursor: pointer;"/>10MB이내 첨부
                  					</span>
                  				<input type="text" id="file_name2" class="input" style="width:200px; height:14px;"  title="첨부파일" readonly="readonly"/>
                  					<span class="file_input">
                  				<input type="file" name="uploads" class="file_input_hidden" title="첨부파일" onchange="javascript: document.getElementById('file_name2').value = this.value" style="cursor: pointer;"/>
                  					<img src="/images/common/btn_file.gif" alt="첨부파일" name="find" id="find" border="0" style="cursor: pointer;"/>10MB이내 첨부
                 				 	</span>
			                  	<input type="text" id="file_name3" class="input" style="width:200px; height:14px;"  title="첨부파일" readonly="readonly"/>
			                  		<span class="file_input">
			                  	<input type="file" name="uploads" class="file_input_hidden" title="첨부파일" onchange="javascript: document.getElementById('file_name3').value = this.value" style="cursor: pointer;"/>
			                  		<img src="/images/common/btn_file.gif" alt="첨부파일" name="find" id="find" border="0" style="cursor: pointer;"/>10MB이내 첨부
			                  	</span>
                  			</td>
						</tr> --%>
					</tbody>
                 </table>
                 </div>
                 </form>
            </dd>
        </dl>
        <dl class="paginate">  	
            <dd class="btn_right">
            	<input type="button" id="btnList" value="목록" class="input_btn_s b" />
            	<input type="button" id="btnWrite" value="저장후 다음단계" class="input_btn_u b" />
            </dd>
        </dl>
        <!-- 오른쪽 내용 부분 -->
    <!-- 컨텐츠 부분 -->
<c:import url="/view/admin/include/footer/adminFooter.jsp"></c:import>
<script type="text/javascript" src="/jquery/datepicker.js"></script>
<script type="text/javascript" src="/jquery/jquery.watermarkinput.js" ></script>
<script type="text/javascript">
	$().ready(function(){		
		$("#btnWrite").click(function(){
			oEditors[0].exec("UPDATE_CONTENTS_FIELD", []);
			if(validateCheck()){
				if(confirm("등록하시겠습니까?")){
					$("#boardFrm").submit();
				}		
			}
		});
		
		$("#btnList").click(function(){
			location.href="/admin/caseList.hcom?";
		});
	});

	var oEditors = [];
	// 에디터 생성
	nhn.husky.EZCreator.createInIFrame({
		oAppRef: oEditors,
		elPlaceHolder: "summary",
		sSkinURI: "/sEditor/SmartEditor2Skin.html",
		fCreator: "createSEditor2",		
	});	
	
	function pasteHTMLDemo(){
		sHTML = "<span style='color:#FF0000'>이미지 등도 이렇게 삽입하면 됩니다.</span>";
		oEditors.getById["summary"].exec("PASTE_HTML", [sHTML]);
	}

	function showHTML(){
		alert(oEditors.getById["summary"].getIR());
	}
	

	/* function number_check2(order_no)
	{
	     var num = "0123456789"
	     var check = 0
	     var str = order_no.value
	     var len = order_no.value.length

	     for(var i=0; i<len; i++)   if(num.indexOf(str.substring(i,i+1)) >= 0)  check++
	     if(check != len){
	            alert('숫자만 입력이 가능합니다')
	            order_no.value=''
	     }
	} */

	function number_check2(sue_money)
	{
	     var num = "0123456789"
	     var check = 0
	     var str = sue_money.value
	     var len = sue_money.value.length

	     for(var i=0; i<len; i++)   if(num.indexOf(str.substring(i,i+1)) >= 0)  check++
	     if(check != len){
	            alert('숫자만 입력이 가능합니다')
	            sue_money.value=''
	     }
	}

	
	function validateCheck(){	
		
		if($("#case_name").val() == ''){
			alert('사건명을 입력해주십시요');
			$("#case_name").focus();
			return false;
		}
		if($("#open_flag").val() == ''){
			alert('공개여부를 선택해주십시요');
			$("#open_flag").focus();
			return false;
		}
		if($("#sue_money").val() == ''){
			alert('금액을 입력해주십시요');
			$("#sue_money").focus();
			return false;
		}
		if($("#plaintiff").val() == ''){
			alert('원고를 입력해주십시요');
			$("#plaintiff").focus();
			return false;
		}
		if($("#defendant").val() == ''){
			alert('피고를 입력해주십시요');
			$("#defendant").focus();
			return false;
		}
		if($("#sue_flag").val() == ''){
			alert('항목을 선택해주십시요');
			$("#sue_flag").focus();
			return false;
		}
		if($("#status_flag").val() == ''){
			alert('항목을 선택해주십시요');
			$("#status_flag").focus();
			return false;
		}
		if($("#summary").val() == ''){
			alert('내용을입력해주십시요');
			return false;
		}	
		return true;
	} 
</script>
